package com.sentiment.database.dbUtil;

import java.util.List;

import org.bson.Document;

public interface Mongodb {

	public void openConnection(String dbName,String collectionName);
	
	public void closeConnection();
	
	public boolean insert(Document t);
	public boolean insertNotExist(Document t,String[] keys);
	public boolean insertMany(List<Document> list);
	public boolean insertManyNotExist(List<Document> list,List<String[]> keysList);
	
	public Document query(Document t,String[] keys);
	public List<Document> queryMany(Document t,String[] keys);
	public List<Document> queryMany(Document start, Document end,String key);
	
	public boolean remove(Document t,String[] keys);
	public long removeMany(Document t,String[] keys);
	
	public boolean update(Document tOld, String[] oKeys, Document tNew, String[] nKeys);
	public long updateMany(Document tOld, String[] oKeys, Document tNew, String[] nKeys);
	
	public long collectionGetCount();
}
